package com.java1412.web.controller.api;

import com.java1412.common.utils.R;
import com.java1412.web.service.LoanInfoService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author java1412
 * @since 2025-05-21 16:52
 */
@RestController
@RequestMapping(value = "/api/loan")
@Api(tags = "前台理财产品信息接口")
public class ApiLoanInfoController {

    @Resource
    private LoanInfoService loanInfoService;

    @GetMapping(value = "/{productType}")
    public R list(
            @PathVariable(value = "productType") Integer productType
    ) {
        R r = loanInfoService.findByProductType(productType);
        return r;
    }
}
